﻿#region Copyright ©2008-2009, Technische Universitaet Muenchen
// ====================================================================================================
//
// Last Changed by       $Author: kalus $
// Last Changed Date     $LastChangedDate: 2009-03-18 16:42:33 +0100 (Wed, 18 Mar 2009) $
// Last Changed Revision $Rev: 36 $
//
// ====================================================================================================
#endregion

using System.Collections.Generic;
using System.Xml;

namespace Tum.CollabXT.VModellXT
{
    public class Activity : IActivity
    {
        #region Private Members
        private string _Id;
        private string _Name;
        private string _Description;
        private Dictionary<string, object> _ExtendedData = new Dictionary<string, object>();

        private int _StandardDuration = 0;
        #endregion

        public Activity() { }
        public Activity(XmlNode node)
        {
            _Id = node.Attributes["id"].Value;
            _Name = node.SelectSingleNode("Name").InnerText;
            _Description = Helper.StripHtmlString(node.SelectSingleNode("Sinn_und_Zweck").InnerXml);
        }

        public override string ToString()
        {
            return _Id + " (" + _Name + ")";
        }

        #region IActivity Members

        public int StandardDuration
        {
            get { return (_StandardDuration); }
            set { _StandardDuration = value; }
        }

        #endregion

        #region IProcessElement Members

        public string Id
        {
            get { return (_Id); }
            set { _Id = value; }
        }

        public string Name
        {
            get { return (_Name); }
            set { _Name = value; }
        }

        public string Description
        {
            get { return (_Description); }
            set { _Description = value; }
        }

        public Dictionary<string, object> ExtendedData
        {
            get { return _ExtendedData; }
        }

        #endregion
    }
}
